package net.sf.rose.business.bean.database;

import org.simpleframework.xml.Attribute;

/**
 * @author fengjian
 * @since 2014-6-11
 */
public class DataTypeMetaBean {

	public static String TIMESTAMP = "java.sql.Timestamp";
	public static String DATE = "java.util.Date";
	public static String STRING = "java.lang.String";

	/** 类型名称 */
	@Attribute
	private String name = null;

	/** 数据库类型 */
	@Attribute
	private String dbType = null;

	/** Java类型 */
	@Attribute
	private String javaType = null;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDbType() {
		return dbType;
	}

	public void setDbType(String dbType) {
		this.dbType = dbType;
	}

	public String getJavaType() {
		return javaType;
	}

	public void setJavaType(String javaType) {
		this.javaType = javaType;
	}

	public boolean isDateType() {
		return this.javaType.equals(DATE) || this.javaType.equals(TIMESTAMP) ? true : false;
	}

	public boolean isStringType() {
		return this.javaType.equals(STRING) ? true : false;
	}

	public boolean isNumberType() {
		return this.javaType.equals("java.lang.Integer") || this.javaType.equals("java.math.BigDecimal") ? true : false;
	}
}
